package com.fashiontextile.admin.mapper;

import com.fashiontextile.admin.entity.Dict;
import com.fashiontextile.admin.entity.DictCategory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DictMapper {
    Dict selectDictByDid(Long did);

    DictCategory selectDictCategory(Long dcid);

    List<Dict> selectDictChildrensByDids(@Param("dids") List<Long> dids);

    List<Dict> selectDictByCategoryId(@Param("dcid") Long dcid, @Param("parentId") Long parentId);

    List<DictCategory> selectAllDictCategory();

    Dict selectDictbyTypeAndValueAndParent(@Param("dcid") Long dcid, @Param("value") String value, @Param("parent") Long parent);

    Integer insertDict(@Param("value") String value, @Param("dcid") Long dcid, @Param("parent") Long parent);

    Integer deleteDictByDid(Long did);

    Integer deleteDictCategoryByDcid(Long dcid);

    DictCategory selectDictcategoryByname(String categoryName);

    Integer insertDictcategory(String dictCategory);

}
